//
//  LoginView.m
//  coffee
//
//  Created by student4 on 2020/12/6.
//  Copyright © 2020 MOSAD. All rights reserved.
//

#import "LoginView.h"

@implementation LoginView
-(void)viewInit{
    [self labelInit];
    [self filedInit];
    [self btnInit];
}
-(void)labelInit{
    UITextView *name = [[UITextView alloc]initWithFrame:CGRectMake(100, 300, 200, 30)];
    [name setText:@"name:"];
    [name setEditable:false];
    [self addSubview:name];
    
    UITextView *pwd = [[UITextView alloc]initWithFrame:CGRectMake(100, 400, 200, 30)];
    [pwd setText:@"password"];
    [pwd setEditable:false];
    [self addSubview:pwd];
}
-(void)filedInit{
    _iname = [[UITextField alloc]initWithFrame:CGRectMake(100, 350, 200, 30)];
    _iname.borderStyle = UITextBorderStyleRoundedRect;
    _iname.autocapitalizationType = UITextAutocapitalizationTypeNone;
//    _iname.layer.borderColor = CFBridgingRetain([[UIColor lightGrayColor] CGColor]);
    _iname.layer.borderWidth = 1.0;
    [self addSubview:_iname];
    
    _ipwd = [[UITextField alloc]initWithFrame:CGRectMake(100, 450, 200, 30)];
    _ipwd.borderStyle = UITextBorderStyleRoundedRect;
    _ipwd.autocapitalizationType = UITextAutocapitalizationTypeNone;
//    _ipwd.layer.borderColor = CFBridgingRetain([[UIColor lightGrayColor] CGColor]);
    _ipwd.layer.borderWidth = 1.0;
    [self addSubview:_ipwd];
}
-(void)btnInit{
    _submit = [[UIButton alloc]initWithFrame:CGRectMake(100, 500, 200, 30)];
    [_submit setTitle:@"login" forState:UIControlStateNormal];
    [_submit setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _submit.layer.masksToBounds = YES;
    _submit.layer.cornerRadius = 5.0;
//    _submit.layer.borderColor = CFBridgingRetain([[UIColor lightGrayColor] CGColor]);
    _submit.layer.borderWidth = 1.0;
    [self addSubview:_submit];
}
@end




@implementation RegistView
-(void)viewInit{
    [self labelInit];
    [self filedInit];
    [self btnInit];
}
-(void)labelInit{
    UITextView *name = [[UITextView alloc]initWithFrame:CGRectMake(100, 300, 200, 30)];
    [name setText:@"name"];
    [name setEditable:false];
    [self addSubview:name];
    
    UITextView *pwd = [[UITextView alloc]initWithFrame:CGRectMake(100, 400, 200, 30)];
    [pwd setText:@"password"];
    [pwd setEditable:false];
    [self addSubview:pwd];
    
    UITextView *email = [[UITextView alloc]initWithFrame:CGRectMake(100, 500, 200, 30)];
    [email setText:@"email"];
    [email setEditable:false];
    [self addSubview:email];
}
-(void)filedInit{
    _iname = [[UITextField alloc]initWithFrame:CGRectMake(100, 350, 200, 30)];
    _iname.borderStyle = UITextBorderStyleRoundedRect;
    _iname.autocapitalizationType = UITextAutocapitalizationTypeNone;
    //    _iname.layer.borderColor = CFBridgingRetain([[UIColor lightGrayColor] CGColor]);
    _iname.layer.borderWidth = 1.0;
    [self addSubview:_iname];
    
    _ipwd = [[UITextField alloc]initWithFrame:CGRectMake(100, 450, 200, 30)];
    _ipwd.borderStyle = UITextBorderStyleRoundedRect;
    _ipwd.autocapitalizationType = UITextAutocapitalizationTypeNone;
    //    _ipwd.layer.borderColor = CFBridgingRetain([[UIColor lightGrayColor] CGColor]);
    _ipwd.layer.borderWidth = 1.0;
    [self addSubview:_ipwd];
    
    _iemail = [[UITextField alloc]initWithFrame:CGRectMake(100, 550, 200, 30)];
    _iemail.borderStyle = UITextBorderStyleRoundedRect;
    _iemail.autocapitalizationType = UITextAutocapitalizationTypeNone;
    //    _iemail.layer.borderColor = CFBridgingRetain([[UIColor lightGrayColor] CGColor]);
    _iemail.layer.borderWidth = 1.0;
    [self addSubview:_iemail];
}
-(void)btnInit{
    _submit = [[UIButton alloc]initWithFrame:CGRectMake(100, 600, 200, 30)];
    [_submit setTitle:@"注册" forState:UIControlStateNormal];
    [_submit setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _submit.layer.masksToBounds = YES;
    _submit.layer.cornerRadius = 5.0;
    //    _submit.layer.borderColor = CFBridgingRetain([[UIColor lightGrayColor] CGColor]);
    _submit.layer.borderWidth = 1.0;
    [self addSubview:_submit];
}
@end
